home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Original Shareware 1.1
/
The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso
/
25
/
arj200.exe
/
arj
/
ARJSORT.BAT
< prev
next >
Wrap
DOS Batch File
|
1991-04-10
|
3KB
|
145 lines
@echo off
echo ARJSORT 1.20, ARJ file sorting tool, Copyright (c) 1990,91 Robert K. Jung
echo .
if "%1"=="" goto param_error
if "%2"=="" goto sort_start
if %2==/A goto sort_start
if %2==/a goto sort_start
if %2==/C goto sort_start
if %2==/c goto sort_start
if %2==/D goto sort_start
if %2==/d goto sort_start
if %2==/E goto sort_start
if %2==/e goto sort_start
if %2==/F goto sort_start
if %2==/f goto sort_start
if %2==/O goto sort_start
if %2==/o goto sort_start
if %2==/P goto sort_start
if %2==/p goto sort_start
if %2==/R goto sort_start
if %2==/r goto sort_start
if %2==/S goto sort_start
if %2==/s goto sort_start
if %2==/T goto sort_start
if %2==/t goto sort_start
goto param_error
:sort_start
echo Getting current order of archive: %1
arj v %1 -jv1 > arjsort.$$1
if errorlevel 1 goto arj_error
if "%2"=="" goto sort_path
if %2==/A goto sort_attr
if %2==/a goto sort_attr
if %2==/C goto sort_crc
if %2==/c goto sort_crc
if %2==/D goto sort_date
if %2==/d goto sort_date
if %2==/E goto sort_ext
if %2==/e goto sort_ext
if %2==/F goto sort_file
if %2==/f goto sort_file
if %2==/O goto sort_ratio
if %2==/o goto sort_ratio
if %2==/P goto sort_path
if %2==/p goto sort_path
if %2==/R goto r_sort_path
if %2==/r goto r_sort_path
if %2==/S goto sort_size
if %2==/s goto sort_size
if %2==/T goto sort_time
if %2==/t goto sort_time
goto param_error
:sort_path
echo Sorting by pathname
echo .
sort /+122 %3 < arjsort.$$1 > arjsort.$$$
goto sort_finish
:r_sort_path
echo Sorting by pathname
echo .
sort /+122 %2 < arjsort.$$1 > arjsort.$$$
goto sort_finish
:sort_attr
echo Sorting by attribute
echo .
sort /+69 %3 < arjsort.$$1 > arjsort.$$$
goto sort_finish
:sort_crc
echo Sorting by CRC
echo .
sort /+60 %3 < arjsort.$$1 > arjsort.$$$
goto sort_finish
:sort_date
echo Sorting by date/time modified
echo .
sort /+41 %3 < arjsort.$$1 > arjsort.$$$
goto sort_finish
:sort_ext
echo Sorting by file extension
echo .
sort /+81 %3 < arjsort.$$1 > arjsort.$$$
goto sort_finish
:sort_file
echo Sorting by filename
echo .
sort /+89 %3 < arjsort.$$1 > arjsort.$$$
goto sort_finish
:sort_ratio
echo Sorting by compression ratio
echo .
sort /+36 %3 < arjsort.$$1 > arjsort.$$$
goto sort_finish
:sort_size
echo Sorting by original file size
echo .
sort /+14 %3 < arjsort.$$1 > arjsort.$$$
goto sort_finish
:sort_time
echo Sorting by time modified
echo .
sort /+51 %3 < arjsort.$$1 > arjsort.$$$
goto sort_finish
:sort_finish
arj o %1 !arjsort.$$$
if errorlevel 1 goto arj_error
if exist arjsort.$$1 del arjsort.$$1 > NUL
if exist arjsort.$$2 del arjsort.$$2 > NUL
if exist arjsort.$$$ del arjsort.$$$ > NUL
if exist arjsort.bak del arjsort.bak > NUL
goto stop
:arj_error
echo ARJ error processing %1
goto stop
:param_error
echo . Usage: ARJSORT archive [/order] [/r]
echo . Where /order is one of the following:
echo .
echo . /a = attribute /o = ratio
echo . /c = crc /p = pathname
echo . /d = date/time /s = size
echo . /e = extension /t = time
echo . /f = filename
echo .
echo . [/r]everse, if specified, must be the last option.
:stop